package com.oracle.oa.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


@Entity                        
@Table(name="messagetype")
public class Messagetype  implements java.io.Serializable {
	 private static final long serialVersionUID = 1L;

	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "messagetypeid", unique = true, nullable = false)   
     private int messagetypeid;
	 
	 @Column(name = "messagetypename", length = 64)
     private String messagetypename;
	 
	 @Column(name = "messagedesc", length = 64)
     private String messagedesc;
	 
	 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
     private Set messages = new HashSet(0);
	 
	public int getMessagetypeid() {
		return messagetypeid;
	}
	public void setMessagetypeid(int messagetypeid) {
		this.messagetypeid = messagetypeid;
	}
	public String getMessagetypename() {
		return messagetypename;
	}
	public void setMessagetypename(String messagetypename) {
		this.messagetypename = messagetypename;
	}
	public String getMessagedesc() {
		return messagedesc;
	}
	public void setMessagedesc(String messagedesc) {
		this.messagedesc = messagedesc;
	}
	public Set getMessages() {
		return messages;
	}
	public void setMessages(Set messages) {
		this.messages = messages;
	}
	public Messagetype(int messagetypeid, String messagetypename,
			String messagedesc, Set messages) {
		this.messagetypeid = messagetypeid;
		this.messagetypename = messagetypename;
		this.messagedesc = messagedesc;
		this.messages = messages;
	}
	public Messagetype() {
		super();
	}
	@Override
	public String toString() {
		return "Messagetype [messagetypeid=" + messagetypeid
				+ ", messagetypename=" + messagetypename + ", messagedesc="
				+ messagedesc + ", messages=" + messages + "]";
	}

     
}